	//分页
	/*初始化 
	 * ajax请求
	 * show分页
	 */
	  var localObj = window.location;
	  var contextPath = localObj.pathname.split("/")[1];
	  var basePath = localObj.protocol+"//"+localObj.host+"/"+contextPath;
	//初始化
	  initPageList(1);
	function initPageList(num){
		$.ajax({
			type: 'get',
	            url: "./list", 
	            data:{
	            	"page":num,
	            	"size":8
	            },
	            dataType:'json',
		        success: function(ajaxData){
		        	//修改数据
		        	var pages = ajaxData.pages;     //因文档加载完毕时执行该函数，则直接在该函数中实时的取值也是包括第一次的值
	                var pageNum = ajaxData.pageNum;
	                var pageSize = ajaxData.size;
	                var totalRows = ajaxData.total;
	            	
		        	 $("#movieListPage").bs_pagination({
		        		currentPage: pageNum,     
			            totalPages: pages,      
			            totalRows :totalRows,
			            visiblePageLinks: 5,
			            rowsPerPage: pageSize,     
			            showGoToPage: false,
			            showRowsPerPage: false,
			            showRowsInfo: false,
			            showRowsDefaultInfo: false,
			            navListContainerClass: "col-xs-12 col-sm-12 col-md-12",//使分页按钮区域占一整行
			            containerClass: "",//包含按钮的class为空，原为well，有背景
			            onLoad: function(event, data) {//分页按钮加载时
			            	showPageList(ajaxData.list);
				            },
			            onChangePage: function(event, data) {//分页按钮改变时
			            	initPageList(data.currentPage,true);
			            }
		        	 });
		        }	
		});
	}
	//分页显示
	function showPageList(data){
		//显示数据
		//定义Id
		$("#showMovieList").empty();//customerListHtml清空
		var tableHtml ='<div class="row">';
		for (var key in data) {
			if(key<=3){
				tableHtml += 
					'<div class="col-1-4">'+
						'<div class="wrap-col">'+
						'<div class="post">'+
							'<div class="view effect">' + 
							  '<img class="thumb" src="'+data[key].image+'"  />' +  
							  '<div class="mask">' + 
									'<a href="detail/'+data[key].movieId+'" class="info" title="Full Image"><img src="/resources/images/play_button_64.png" /></a>'+ 
							  '</div>' + 
							'</div>'+
							'<a href="single.html"><h3>'+data[key].movieTitle+'</h3></a>'+
							'<span>'+data[key].releaseDate+'</span>'+
						'</div>'+
						'</div>'+
					'</div>'
			}else{
				if(key == 4){
					tableHtml +='</div>'+'<div class="row">';
				}
				tableHtml += 
					'<div class="col-1-4">'+
						'<div class="wrap-col">'+
						'<div class="post">'+
							'<div class="view effect">' + 
							  '<img class="thumb" src="'+data[key].image+'"  />' +  
							  '<div class="mask">' + 
									'<a href="detail/'+data[key].id+'" class="info" title="Full Image"><img src="'+basePath+'/resources/images/play_button_64.png" /></a>'+ 
							  '</div>' + 
							'</div>'+
							'<a href="single.html"><h3>'+data[key].movieTitle+'</h3></a>'+
							'<span>'+data[key].releaseDate+'</span>'+
						'</div>'+
						'</div>'+
					'</div>'
			}
        };
        tableHtml +='</div>';
        //id插入对应的表中
        $("#showMovieList").prepend(tableHtml);
        
        
        
        
        
        
        
        
        
        //显示推荐电影信息
        var html = "";
        $.ajax({
			type: 'post',
	            url: "./admin/score/getTopMovies", 
	            dataType:'json',
		        success: function(data){
		        	for(var key in data){
		        		html +=
		        			'<div class="post">'
			        			+'<a href="#"><img src="'+data[key].image+'"/></a>'
			        			+'<div class="wrapper">'
			        				+'<a href="#"><h6>'+data[key].movieTitle+'</h6></a>'
			        				+'<p>'+data[key].uploadtime+'</p>'
			        				+'<a href="#"><img src="/resources/images/star.png" /></a>'
			        			+'</div>'
		        			+'</div>'
		        	}
		        	$("#showTopMovie").prepend(html);
		        }
        });
	}